import org.rsbot.script.methods.Interfaces;
import org.rsbot.script.wrappers.RSComponent;
import org.rsbot.script.wrappers.RSInterface;

class VoluntaryThieve$Actions$6 extends VoluntaryThieve.Action
{
  boolean isFirstDone;

  VoluntaryThieve.Action.State perform()
  {
    RSInterface localRSInterface;
    if (!this.isFirstDone) {
      localRSInterface = VoluntaryThieve.access$5000(this.this$1.this$0).get(241);
      this.isFirstDone = ((localRSInterface != null) && (localRSInterface.isValid()));
    }

    if (this.isFirstDone) {
      localRSInterface = VoluntaryThieve.access$5100(this.this$1.this$0).get(241);
      if ((localRSInterface != null) && (localRSInterface.isValid()) && 
        (localRSInterface.getComponent(5).doClick()))
        return VoluntaryThieve.Action.State.COMPLETED;
    }
    else {
      localRSInterface = VoluntaryThieve.access$5200(this.this$1.this$0).get(64);
      if ((localRSInterface != null) && (localRSInterface.isValid())) {
        this.isFirstDone = localRSInterface.getComponent(5).doClick();
      }
    }
    return VoluntaryThieve.Action.State.PROGRESSING;
  }

  VoluntaryThieve.Action.State finish()
  {
    RSInterface localRSInterface = VoluntaryThieve.access$5300(this.this$1.this$0).get(241);
    if ((localRSInterface == null) || (!localRSInterface.isValid())) {
      VoluntaryThieve.Actions.access$5402(this.this$1, true);
      return VoluntaryThieve.Action.State.COMPLETED;
    }

    return VoluntaryThieve.Action.State.PROGRESSING;
  }
}